package server

import (
	"mime/multipart"
	"net/http"
	"net/url"
)

type Context interface {
	toJson() []byte
	write()
	StateCode(code int)
	Result(code int, data interface{}) Result
	Response() *Response
	Request() *http.Request
	GetBody() string
	Param(key string) string
	Form() url.Values
	PostForm() url.Values
	GetFormFile(key string) (multipart.File, *multipart.FileHeader, error)
	Cookie() Cookie
	Session() Session
	LoginAuth()
	TplHtml(tplName string) *Html
}

type Result interface {
	Success()
	Fail()
}

type Session interface {
	Set(key string, value interface{})
	Get(key string) interface{}
	Id() string
	auth()
	getAuth() bool
}

type Cookie interface {
	Set(key string, value string)
	Get(key string) string
}
